from modeller import *
from modeller.scripts import complete_pdb

def evaluate():

    log.verbose()    
    env = environ()
    env.libs.topology.read(file='$(LIB)/top_heav.lib') 
    env.libs.parameters.read(file='$(LIB)/par.lib')


    preys = ['prey3','prey4-1','prey5', 'prey13', 'prey15'] #the name of the initial .ali files;
                                                            #the generated pdb models all begin with this names.

    for i in preys:

        count = range(1,11)
        for j in count: #this loop should work if you evaluate less than 100 models per initial .ali file.

            if j < 10:
             
                mdl = complete_pdb(env, str(i)+'.B9999000'+ str(j)+'.pdb')

               
                s = selection(mdl)
                s.assess_dope(output='ENERGY_PROFILE NO_REPORT', file=str(i)+'.B9999000'+ str(j)+'.pdb'+'.profile',
                              normalize_profile=True, smoothing_window=15)
            else:
                mdl = complete_pdb(env, str(i)+'.B999900'+str(j)+'.pdb')

             
                s = selection(mdl)
                s.assess_dope(output='ENERGY_PROFILE NO_REPORT', file=str(i)+'.B999900'+ str(j)+'.pdb'+'.profile',
                              normalize_profile=True, smoothing_window=15)



evaluate()
